<script>
import { setName } from '@/api/test/test.js'

export default {
  methods: {
    onSubmit() {
      setName(form.name).then((res) => {
        alert(res.data.data)
      })
    }
  }, data() {
    return {
      form
    }
  }
}

import { reactive } from 'vue'

// do not use same name with ref
const form = reactive({
  name: '',
})



</script>

<template>
  <div class="about">
    <el-form :model="form" label-width="auto" style="max-width: 600px">
      <el-form-item label="Activity name">
        <el-input v-model="form.name" />
      </el-form-item>

      <el-form-item>
        <el-button type="primary" @click="onSubmit">Create</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<style>
@media (min-width: 1024px) {
  .about {
    min-height: 100vh;
    display: flex;
    align-items: center;
  }
}
</style>
